﻿using Hotel.DAL;
using Hotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotel.BLL
{
    public class MemberLevelBLL
    {
        public MemberLevelBLL(MemberLevelDAL memberLevelDAL)
        {
            MemberLevelDAL = memberLevelDAL;
        }

        public MemberLevelDAL MemberLevelDAL { get; }
        public int AddMemberLevel(MemberLevel info)
        {
            try
            {
                return MemberLevelDAL.AddMemberLevel(info);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// 获取会员等级列表
        /// </summary>
        /// <returns></returns>
        public List<MemberLevel> MemberLevelsList()
        {
            try
            {
                return MemberLevelDAL.MemberLevelsList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 获取会员列表
        /// </summary>
        /// <param name="id">会员编号</param>
        /// <param name="name">会员名称</param>
        /// <param name="levelId">等级名称</param>
        /// <returns></returns>
        public List<Member> MemberList(int? id = null, string? name = "", int? levelId = null)
        {
            try
            {
                //查询所有显示的数据
               return MemberLevelDAL.MemberList(id, name, levelId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
